{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "0af93465-2667-4141-b92c-0a49d727201d",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Vehicle_ID</th>\n",
       "      <th>Frame_ID</th>\n",
       "      <th>Total_Frames</th>\n",
       "      <th>Global_Time</th>\n",
       "      <th>Local_X</th>\n",
       "      <th>Local_Y</th>\n",
       "      <th>Global_X</th>\n",
       "      <th>Global_Y</th>\n",
       "      <th>v_Length</th>\n",
       "      <th>v_Width</th>\n",
       "      <th>...</th>\n",
       "      <th>v_Acc</th>\n",
       "      <th>Lane_ID</th>\n",
       "      <th>Preceeding</th>\n",
       "      <th>Following</th>\n",
       "      <th>Space_Hdwy</th>\n",
       "      <th>Time_Hdwy</th>\n",
       "      <th>x</th>\n",
       "      <th>x_a</th>\n",
       "      <th>y</th>\n",
       "      <th>y_v</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>6</td>\n",
       "      <td>537</td>\n",
       "      <td>577</td>\n",
       "      <td>1118847895700</td>\n",
       "      <td>51.327</td>\n",
       "      <td>738.159285</td>\n",
       "      <td>6451593.879</td>\n",
       "      <td>1872857.446</td>\n",
       "      <td>15.5</td>\n",
       "      <td>7.4</td>\n",
       "      <td>...</td>\n",
       "      <td>-1.669198</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>16</td>\n",
       "      <td>82.43</td>\n",
       "      <td>2.75</td>\n",
       "      <td>-0.069</td>\n",
       "      <td>-0.69</td>\n",
       "      <td>2.926326</td>\n",
       "      <td>29.263260</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>6</td>\n",
       "      <td>538</td>\n",
       "      <td>577</td>\n",
       "      <td>1118847895800</td>\n",
       "      <td>51.259</td>\n",
       "      <td>741.069808</td>\n",
       "      <td>6451596.178</td>\n",
       "      <td>1872855.518</td>\n",
       "      <td>15.5</td>\n",
       "      <td>7.4</td>\n",
       "      <td>...</td>\n",
       "      <td>-1.751698</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>16</td>\n",
       "      <td>81.98</td>\n",
       "      <td>2.74</td>\n",
       "      <td>-0.068</td>\n",
       "      <td>-0.68</td>\n",
       "      <td>2.910523</td>\n",
       "      <td>29.105229</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>6</td>\n",
       "      <td>539</td>\n",
       "      <td>577</td>\n",
       "      <td>1118847895900</td>\n",
       "      <td>51.185</td>\n",
       "      <td>743.963695</td>\n",
       "      <td>6451598.500</td>\n",
       "      <td>1872853.578</td>\n",
       "      <td>15.5</td>\n",
       "      <td>7.4</td>\n",
       "      <td>...</td>\n",
       "      <td>-1.831329</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>16</td>\n",
       "      <td>81.45</td>\n",
       "      <td>2.76</td>\n",
       "      <td>-0.074</td>\n",
       "      <td>-0.74</td>\n",
       "      <td>2.893887</td>\n",
       "      <td>28.938867</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>6</td>\n",
       "      <td>540</td>\n",
       "      <td>577</td>\n",
       "      <td>1118847896000</td>\n",
       "      <td>51.156</td>\n",
       "      <td>746.840082</td>\n",
       "      <td>6451600.740</td>\n",
       "      <td>1872851.650</td>\n",
       "      <td>15.5</td>\n",
       "      <td>7.4</td>\n",
       "      <td>...</td>\n",
       "      <td>-1.872445</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>16</td>\n",
       "      <td>80.95</td>\n",
       "      <td>2.81</td>\n",
       "      <td>-0.029</td>\n",
       "      <td>-0.29</td>\n",
       "      <td>2.876387</td>\n",
       "      <td>28.763871</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>6</td>\n",
       "      <td>541</td>\n",
       "      <td>577</td>\n",
       "      <td>1118847896100</td>\n",
       "      <td>51.132</td>\n",
       "      <td>749.698492</td>\n",
       "      <td>6451602.894</td>\n",
       "      <td>1872849.790</td>\n",
       "      <td>15.5</td>\n",
       "      <td>7.4</td>\n",
       "      <td>...</td>\n",
       "      <td>-1.839746</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>16</td>\n",
       "      <td>80.55</td>\n",
       "      <td>2.89</td>\n",
       "      <td>-0.024</td>\n",
       "      <td>-0.24</td>\n",
       "      <td>2.858410</td>\n",
       "      <td>28.584104</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13648</th>\n",
       "      <td>1914</td>\n",
       "      <td>7001</td>\n",
       "      <td>923</td>\n",
       "      <td>1118848542100</td>\n",
       "      <td>12.851</td>\n",
       "      <td>369.891951</td>\n",
       "      <td>6451346.112</td>\n",
       "      <td>1873133.726</td>\n",
       "      <td>16.5</td>\n",
       "      <td>6.4</td>\n",
       "      <td>...</td>\n",
       "      <td>-2.247724</td>\n",
       "      <td>2</td>\n",
       "      <td>1928</td>\n",
       "      <td>1939</td>\n",
       "      <td>41.10</td>\n",
       "      <td>1.26</td>\n",
       "      <td>-0.302</td>\n",
       "      <td>-3.02</td>\n",
       "      <td>3.411126</td>\n",
       "      <td>34.111262</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13649</th>\n",
       "      <td>1914</td>\n",
       "      <td>7002</td>\n",
       "      <td>923</td>\n",
       "      <td>1118848542200</td>\n",
       "      <td>12.519</td>\n",
       "      <td>373.280969</td>\n",
       "      <td>6451348.671</td>\n",
       "      <td>1873131.714</td>\n",
       "      <td>16.5</td>\n",
       "      <td>6.4</td>\n",
       "      <td>...</td>\n",
       "      <td>-2.080567</td>\n",
       "      <td>2</td>\n",
       "      <td>1928</td>\n",
       "      <td>1939</td>\n",
       "      <td>40.86</td>\n",
       "      <td>1.26</td>\n",
       "      <td>-0.332</td>\n",
       "      <td>-3.32</td>\n",
       "      <td>3.389018</td>\n",
       "      <td>33.890178</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13650</th>\n",
       "      <td>1914</td>\n",
       "      <td>7003</td>\n",
       "      <td>923</td>\n",
       "      <td>1118848542300</td>\n",
       "      <td>12.212</td>\n",
       "      <td>376.649614</td>\n",
       "      <td>6451351.221</td>\n",
       "      <td>1873129.677</td>\n",
       "      <td>16.5</td>\n",
       "      <td>6.4</td>\n",
       "      <td>...</td>\n",
       "      <td>-1.942366</td>\n",
       "      <td>2</td>\n",
       "      <td>1928</td>\n",
       "      <td>1939</td>\n",
       "      <td>40.62</td>\n",
       "      <td>1.25</td>\n",
       "      <td>-0.307</td>\n",
       "      <td>-3.07</td>\n",
       "      <td>3.368645</td>\n",
       "      <td>33.686446</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13651</th>\n",
       "      <td>1914</td>\n",
       "      <td>7004</td>\n",
       "      <td>923</td>\n",
       "      <td>1118848542400</td>\n",
       "      <td>11.904</td>\n",
       "      <td>379.999326</td>\n",
       "      <td>6451353.771</td>\n",
       "      <td>1873127.640</td>\n",
       "      <td>16.5</td>\n",
       "      <td>6.4</td>\n",
       "      <td>...</td>\n",
       "      <td>-1.840038</td>\n",
       "      <td>2</td>\n",
       "      <td>1928</td>\n",
       "      <td>1939</td>\n",
       "      <td>40.37</td>\n",
       "      <td>1.24</td>\n",
       "      <td>-0.308</td>\n",
       "      <td>-3.08</td>\n",
       "      <td>3.349713</td>\n",
       "      <td>33.497126</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13652</th>\n",
       "      <td>1914</td>\n",
       "      <td>7005</td>\n",
       "      <td>923</td>\n",
       "      <td>1118848542500</td>\n",
       "      <td>11.597</td>\n",
       "      <td>383.331093</td>\n",
       "      <td>6451356.321</td>\n",
       "      <td>1873125.603</td>\n",
       "      <td>16.5</td>\n",
       "      <td>6.4</td>\n",
       "      <td>...</td>\n",
       "      <td>-1.778293</td>\n",
       "      <td>1</td>\n",
       "      <td>1909</td>\n",
       "      <td>1917</td>\n",
       "      <td>28.63</td>\n",
       "      <td>0.88</td>\n",
       "      <td>-0.307</td>\n",
       "      <td>-3.07</td>\n",
       "      <td>3.331766</td>\n",
       "      <td>33.317664</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>13653 rows × 22 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       Vehicle_ID  Frame_ID  Total_Frames    Global_Time  Local_X     Local_Y  \\\n",
       "0               6       537           577  1118847895700   51.327  738.159285   \n",
       "1               6       538           577  1118847895800   51.259  741.069808   \n",
       "2               6       539           577  1118847895900   51.185  743.963695   \n",
       "3               6       540           577  1118847896000   51.156  746.840082   \n",
       "4               6       541           577  1118847896100   51.132  749.698492   \n",
       "...           ...       ...           ...            ...      ...         ...   \n",
       "13648        1914      7001           923  1118848542100   12.851  369.891951   \n",
       "13649        1914      7002           923  1118848542200   12.519  373.280969   \n",
       "13650        1914      7003           923  1118848542300   12.212  376.649614   \n",
       "13651        1914      7004           923  1118848542400   11.904  379.999326   \n",
       "13652        1914      7005           923  1118848542500   11.597  383.331093   \n",
       "\n",
       "          Global_X     Global_Y  v_Length  v_Width  ...     v_Acc  Lane_ID  \\\n",
       "0      6451593.879  1872857.446      15.5      7.4  ... -1.669198        5   \n",
       "1      6451596.178  1872855.518      15.5      7.4  ... -1.751698        5   \n",
       "2      6451598.500  1872853.578      15.5      7.4  ... -1.831329        5   \n",
       "3      6451600.740  1872851.650      15.5      7.4  ... -1.872445        5   \n",
       "4      6451602.894  1872849.790      15.5      7.4  ... -1.839746        5   \n",
       "...            ...          ...       ...      ...  ...       ...      ...   \n",
       "13648  6451346.112  1873133.726      16.5      6.4  ... -2.247724        2   \n",
       "13649  6451348.671  1873131.714      16.5      6.4  ... -2.080567        2   \n",
       "13650  6451351.221  1873129.677      16.5      6.4  ... -1.942366        2   \n",
       "13651  6451353.771  1873127.640      16.5      6.4  ... -1.840038        2   \n",
       "13652  6451356.321  1873125.603      16.5      6.4  ... -1.778293        1   \n",
       "\n",
       "       Preceeding  Following  Space_Hdwy  Time_Hdwy      x   x_a         y  \\\n",
       "0               1         16       82.43       2.75 -0.069 -0.69  2.926326   \n",
       "1               1         16       81.98       2.74 -0.068 -0.68  2.910523   \n",
       "2               1         16       81.45       2.76 -0.074 -0.74  2.893887   \n",
       "3               1         16       80.95       2.81 -0.029 -0.29  2.876387   \n",
       "4               1         16       80.55       2.89 -0.024 -0.24  2.858410   \n",
       "...           ...        ...         ...        ...    ...   ...       ...   \n",
       "13648        1928       1939       41.10       1.26 -0.302 -3.02  3.411126   \n",
       "13649        1928       1939       40.86       1.26 -0.332 -3.32  3.389018   \n",
       "13650        1928       1939       40.62       1.25 -0.307 -3.07  3.368645   \n",
       "13651        1928       1939       40.37       1.24 -0.308 -3.08  3.349713   \n",
       "13652        1909       1917       28.63       0.88 -0.307 -3.07  3.331766   \n",
       "\n",
       "             y_v  \n",
       "0      29.263260  \n",
       "1      29.105229  \n",
       "2      28.938867  \n",
       "3      28.763871  \n",
       "4      28.584104  \n",
       "...          ...  \n",
       "13648  34.111262  \n",
       "13649  33.890178  \n",
       "13650  33.686446  \n",
       "13651  33.497126  \n",
       "13652  33.317664  \n",
       "\n",
       "[13653 rows x 22 columns]"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "f2 = pd.read_csv(\"./data/CL_train41.csv\")          # 读入车辆换道数据\n",
    "f2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "a740e5e2-1e57-4a33-8521-969d1dc2c2f7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "333.0"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(f2)/41                                      #计算换道次数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "3189bc3b-af29-45a6-9ac7-1406d802ed2b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[40,\n",
       " 81,\n",
       " 122,\n",
       " 163,\n",
       " 204,\n",
       " 245,\n",
       " 286,\n",
       " 327,\n",
       " 368,\n",
       " 409,\n",
       " 450,\n",
       " 491,\n",
       " 532,\n",
       " 573,\n",
       " 614,\n",
       " 655,\n",
       " 696,\n",
       " 737,\n",
       " 778,\n",
       " 819,\n",
       " 860,\n",
       " 901,\n",
       " 942,\n",
       " 983,\n",
       " 1024,\n",
       " 1065,\n",
       " 1106,\n",
       " 1147,\n",
       " 1188,\n",
       " 1229,\n",
       " 1270,\n",
       " 1311,\n",
       " 1352,\n",
       " 1393,\n",
       " 1434,\n",
       " 1475,\n",
       " 1516,\n",
       " 1557,\n",
       " 1598,\n",
       " 1639,\n",
       " 1680,\n",
       " 1721,\n",
       " 1762,\n",
       " 1803,\n",
       " 1844,\n",
       " 1885,\n",
       " 1926,\n",
       " 1967,\n",
       " 2008,\n",
       " 2049,\n",
       " 2090,\n",
       " 2131,\n",
       " 2172,\n",
       " 2213,\n",
       " 2254,\n",
       " 2295,\n",
       " 2336,\n",
       " 2377,\n",
       " 2418,\n",
       " 2459,\n",
       " 2500,\n",
       " 2541,\n",
       " 2582,\n",
       " 2623,\n",
       " 2664,\n",
       " 2705,\n",
       " 2746,\n",
       " 2787,\n",
       " 2828,\n",
       " 2869,\n",
       " 2910,\n",
       " 2951,\n",
       " 2992,\n",
       " 3033,\n",
       " 3074,\n",
       " 3115,\n",
       " 3156,\n",
       " 3197,\n",
       " 3238,\n",
       " 3279,\n",
       " 3320,\n",
       " 3361,\n",
       " 3402,\n",
       " 3443,\n",
       " 3484,\n",
       " 3525,\n",
       " 3566,\n",
       " 3607,\n",
       " 3648,\n",
       " 3689,\n",
       " 3730,\n",
       " 3771,\n",
       " 3812,\n",
       " 3853,\n",
       " 3894,\n",
       " 3935,\n",
       " 3976,\n",
       " 4017,\n",
       " 4058,\n",
       " 4099,\n",
       " 4140,\n",
       " 4181,\n",
       " 4222,\n",
       " 4263,\n",
       " 4304,\n",
       " 4345,\n",
       " 4386,\n",
       " 4427,\n",
       " 4468,\n",
       " 4509,\n",
       " 4550,\n",
       " 4591,\n",
       " 4632,\n",
       " 4673,\n",
       " 4714,\n",
       " 4755,\n",
       " 4796,\n",
       " 4837,\n",
       " 4878,\n",
       " 4919,\n",
       " 4960,\n",
       " 5001,\n",
       " 5042,\n",
       " 5083,\n",
       " 5124,\n",
       " 5165,\n",
       " 5206,\n",
       " 5247,\n",
       " 5288,\n",
       " 5329,\n",
       " 5370,\n",
       " 5411,\n",
       " 5452,\n",
       " 5493,\n",
       " 5534,\n",
       " 5575,\n",
       " 5616,\n",
       " 5657,\n",
       " 5698,\n",
       " 5739,\n",
       " 5780,\n",
       " 5821,\n",
       " 5862,\n",
       " 5903,\n",
       " 5944,\n",
       " 5985,\n",
       " 6026,\n",
       " 6067,\n",
       " 6108,\n",
       " 6149,\n",
       " 6190,\n",
       " 6231,\n",
       " 6272,\n",
       " 6313,\n",
       " 6354,\n",
       " 6395,\n",
       " 6436,\n",
       " 6477,\n",
       " 6518,\n",
       " 6559,\n",
       " 6600,\n",
       " 6641,\n",
       " 6682,\n",
       " 6723,\n",
       " 6764,\n",
       " 6805,\n",
       " 6846,\n",
       " 6887,\n",
       " 6928,\n",
       " 6969,\n",
       " 7010,\n",
       " 7051,\n",
       " 7092,\n",
       " 7133,\n",
       " 7174,\n",
       " 7215,\n",
       " 7256,\n",
       " 7297,\n",
       " 7338,\n",
       " 7379,\n",
       " 7420,\n",
       " 7461,\n",
       " 7502,\n",
       " 7543,\n",
       " 7584,\n",
       " 7625,\n",
       " 7666,\n",
       " 7707,\n",
       " 7748,\n",
       " 7789,\n",
       " 7830,\n",
       " 7871,\n",
       " 7912,\n",
       " 7953,\n",
       " 7994,\n",
       " 8035,\n",
       " 8076,\n",
       " 8117,\n",
       " 8158,\n",
       " 8199,\n",
       " 8240,\n",
       " 8281,\n",
       " 8322,\n",
       " 8363,\n",
       " 8404,\n",
       " 8445,\n",
       " 8486,\n",
       " 8527,\n",
       " 8568,\n",
       " 8609,\n",
       " 8650,\n",
       " 8691,\n",
       " 8732,\n",
       " 8773,\n",
       " 8814,\n",
       " 8855,\n",
       " 8896,\n",
       " 8937,\n",
       " 8978,\n",
       " 9019,\n",
       " 9060,\n",
       " 9101,\n",
       " 9142,\n",
       " 9183,\n",
       " 9224,\n",
       " 9265,\n",
       " 9306,\n",
       " 9347,\n",
       " 9388,\n",
       " 9429,\n",
       " 9470,\n",
       " 9511,\n",
       " 9552,\n",
       " 9593,\n",
       " 9634,\n",
       " 9675,\n",
       " 9716,\n",
       " 9757,\n",
       " 9798,\n",
       " 9839,\n",
       " 9880,\n",
       " 9921,\n",
       " 9962,\n",
       " 10003,\n",
       " 10044,\n",
       " 10085,\n",
       " 10126,\n",
       " 10167,\n",
       " 10208,\n",
       " 10249,\n",
       " 10290,\n",
       " 10331,\n",
       " 10372,\n",
       " 10413,\n",
       " 10454,\n",
       " 10495,\n",
       " 10536,\n",
       " 10577,\n",
       " 10618,\n",
       " 10659,\n",
       " 10700,\n",
       " 10741,\n",
       " 10782,\n",
       " 10823,\n",
       " 10864,\n",
       " 10905,\n",
       " 10946,\n",
       " 10987,\n",
       " 11028,\n",
       " 11069,\n",
       " 11110,\n",
       " 11151,\n",
       " 11192,\n",
       " 11233,\n",
       " 11274,\n",
       " 11315,\n",
       " 11356,\n",
       " 11397,\n",
       " 11438,\n",
       " 11479,\n",
       " 11520,\n",
       " 11561,\n",
       " 11602,\n",
       " 11643,\n",
       " 11684,\n",
       " 11725,\n",
       " 11766,\n",
       " 11807,\n",
       " 11848,\n",
       " 11889,\n",
       " 11930,\n",
       " 11971,\n",
       " 12012,\n",
       " 12053,\n",
       " 12094,\n",
       " 12135,\n",
       " 12176,\n",
       " 12217,\n",
       " 12258,\n",
       " 12299,\n",
       " 12340,\n",
       " 12381,\n",
       " 12422,\n",
       " 12463,\n",
       " 12504,\n",
       " 12545,\n",
       " 12586,\n",
       " 12627,\n",
       " 12668,\n",
       " 12709,\n",
       " 12750,\n",
       " 12791,\n",
       " 12832,\n",
       " 12873,\n",
       " 12914,\n",
       " 12955,\n",
       " 12996,\n",
       " 13037,\n",
       " 13078,\n",
       " 13119,\n",
       " 13160,\n",
       " 13201,\n",
       " 13242,\n",
       " 13283,\n",
       " 13324,\n",
       " 13365,\n",
       " 13406,\n",
       " 13447,\n",
       " 13488,\n",
       " 13529,\n",
       " 13570,\n",
       " 13611,\n",
       " 13652]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "CL_num=int(len(f2)/41)\n",
    "obj_list=[41*i-1 for i in range(CL_num+1)]\n",
    "obj_list=obj_list[1:]\n",
    "obj_list                                     #每41帧数据中的最后一帧"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "62cbb3e4-7819-497a-973f-df5ca2bd6ba2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "333"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(obj_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "962aefcd-aa08-47b6-87f3-2bafb3ffb3ff",
   "metadata": {},
   "outputs": [],
   "source": [
    "TR_row=[]              #存放发生右转的前40帧数据\n",
    "for i in obj_list:\n",
    "    if f2['Vehicle_ID'][i]==f2['Vehicle_ID'][i-1] and f2['Lane_ID'][i]==f2['Lane_ID'][i-1]+1:\n",
    "        TR_row.extend(i-40+a for a in range(40))\n",
    "TL_row=[]             #存放发生左转的前40帧数据\n",
    "for i in obj_list:\n",
    "    if f2['Vehicle_ID'][i]==f2['Vehicle_ID'][i-1] and f2['Lane_ID'][i]==f2['Lane_ID'][i-1]-1:\n",
    "        TL_row.extend(i-40+a for a in range(40))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "a335f0fb-7145-42b0-b4cf-fbac8a43a3cb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "105.0"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(TR_row)/40"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "ef92a330-d348-4c17-857e-f3a1610bc7ea",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "223.0"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(TL_row)/40"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "50422b15-ec73-412f-bcbf-0d66ddb841a4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Vehicle_ID</th>\n",
       "      <th>Frame_ID</th>\n",
       "      <th>Total_Frames</th>\n",
       "      <th>Global_Time</th>\n",
       "      <th>Local_X</th>\n",
       "      <th>Local_Y</th>\n",
       "      <th>Global_X</th>\n",
       "      <th>Global_Y</th>\n",
       "      <th>v_Length</th>\n",
       "      <th>v_Width</th>\n",
       "      <th>...</th>\n",
       "      <th>Lane_ID</th>\n",
       "      <th>Preceeding</th>\n",
       "      <th>Following</th>\n",
       "      <th>Space_Hdwy</th>\n",
       "      <th>Time_Hdwy</th>\n",
       "      <th>x</th>\n",
       "      <th>x_a</th>\n",
       "      <th>y</th>\n",
       "      <th>y_v</th>\n",
       "      <th>label</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>41</th>\n",
       "      <td>11</td>\n",
       "      <td>831</td>\n",
       "      <td>654</td>\n",
       "      <td>1118847925100</td>\n",
       "      <td>31.073</td>\n",
       "      <td>1826.355878</td>\n",
       "      <td>6452425.171</td>\n",
       "      <td>1872157.346</td>\n",
       "      <td>17.0</td>\n",
       "      <td>6.4</td>\n",
       "      <td>...</td>\n",
       "      <td>3</td>\n",
       "      <td>7</td>\n",
       "      <td>15</td>\n",
       "      <td>68.67</td>\n",
       "      <td>1.37</td>\n",
       "      <td>0.024</td>\n",
       "      <td>0.24</td>\n",
       "      <td>5.061758</td>\n",
       "      <td>50.617583</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>11</td>\n",
       "      <td>832</td>\n",
       "      <td>654</td>\n",
       "      <td>1118847925200</td>\n",
       "      <td>31.096</td>\n",
       "      <td>1831.427895</td>\n",
       "      <td>6452428.947</td>\n",
       "      <td>1872154.069</td>\n",
       "      <td>17.0</td>\n",
       "      <td>6.4</td>\n",
       "      <td>...</td>\n",
       "      <td>3</td>\n",
       "      <td>7</td>\n",
       "      <td>15</td>\n",
       "      <td>69.19</td>\n",
       "      <td>1.37</td>\n",
       "      <td>0.023</td>\n",
       "      <td>0.23</td>\n",
       "      <td>5.072018</td>\n",
       "      <td>50.720176</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>43</th>\n",
       "      <td>11</td>\n",
       "      <td>833</td>\n",
       "      <td>654</td>\n",
       "      <td>1118847925300</td>\n",
       "      <td>31.120</td>\n",
       "      <td>1836.510543</td>\n",
       "      <td>6452432.723</td>\n",
       "      <td>1872150.792</td>\n",
       "      <td>17.0</td>\n",
       "      <td>6.4</td>\n",
       "      <td>...</td>\n",
       "      <td>3</td>\n",
       "      <td>7</td>\n",
       "      <td>15</td>\n",
       "      <td>69.70</td>\n",
       "      <td>1.38</td>\n",
       "      <td>0.024</td>\n",
       "      <td>0.24</td>\n",
       "      <td>5.082648</td>\n",
       "      <td>50.826477</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>44</th>\n",
       "      <td>11</td>\n",
       "      <td>834</td>\n",
       "      <td>654</td>\n",
       "      <td>1118847925400</td>\n",
       "      <td>31.132</td>\n",
       "      <td>1841.603540</td>\n",
       "      <td>6452436.499</td>\n",
       "      <td>1872147.514</td>\n",
       "      <td>17.0</td>\n",
       "      <td>6.4</td>\n",
       "      <td>...</td>\n",
       "      <td>3</td>\n",
       "      <td>7</td>\n",
       "      <td>15</td>\n",
       "      <td>70.25</td>\n",
       "      <td>1.39</td>\n",
       "      <td>0.012</td>\n",
       "      <td>0.12</td>\n",
       "      <td>5.092997</td>\n",
       "      <td>50.929970</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45</th>\n",
       "      <td>11</td>\n",
       "      <td>835</td>\n",
       "      <td>654</td>\n",
       "      <td>1118847925500</td>\n",
       "      <td>31.122</td>\n",
       "      <td>1846.706961</td>\n",
       "      <td>6452440.275</td>\n",
       "      <td>1872144.237</td>\n",
       "      <td>17.0</td>\n",
       "      <td>6.4</td>\n",
       "      <td>...</td>\n",
       "      <td>3</td>\n",
       "      <td>7</td>\n",
       "      <td>15</td>\n",
       "      <td>70.91</td>\n",
       "      <td>1.41</td>\n",
       "      <td>-0.010</td>\n",
       "      <td>-0.10</td>\n",
       "      <td>5.103421</td>\n",
       "      <td>51.034206</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13606</th>\n",
       "      <td>1906</td>\n",
       "      <td>7852</td>\n",
       "      <td>924</td>\n",
       "      <td>1118848627200</td>\n",
       "      <td>45.670</td>\n",
       "      <td>2034.419128</td>\n",
       "      <td>6452574.737</td>\n",
       "      <td>1872010.049</td>\n",
       "      <td>12.5</td>\n",
       "      <td>5.0</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>1891</td>\n",
       "      <td>1907</td>\n",
       "      <td>117.96</td>\n",
       "      <td>2.94</td>\n",
       "      <td>0.456</td>\n",
       "      <td>4.56</td>\n",
       "      <td>3.916751</td>\n",
       "      <td>39.167513</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13607</th>\n",
       "      <td>1906</td>\n",
       "      <td>7853</td>\n",
       "      <td>924</td>\n",
       "      <td>1118848627300</td>\n",
       "      <td>45.939</td>\n",
       "      <td>2038.340383</td>\n",
       "      <td>6452577.678</td>\n",
       "      <td>1872007.304</td>\n",
       "      <td>12.5</td>\n",
       "      <td>5.0</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>1891</td>\n",
       "      <td>1907</td>\n",
       "      <td>117.95</td>\n",
       "      <td>2.95</td>\n",
       "      <td>0.269</td>\n",
       "      <td>2.69</td>\n",
       "      <td>3.921255</td>\n",
       "      <td>39.212552</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13608</th>\n",
       "      <td>1906</td>\n",
       "      <td>7854</td>\n",
       "      <td>924</td>\n",
       "      <td>1118848627400</td>\n",
       "      <td>46.065</td>\n",
       "      <td>2042.265192</td>\n",
       "      <td>6452580.673</td>\n",
       "      <td>1872004.699</td>\n",
       "      <td>12.5</td>\n",
       "      <td>5.0</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>1891</td>\n",
       "      <td>1907</td>\n",
       "      <td>117.95</td>\n",
       "      <td>2.96</td>\n",
       "      <td>0.126</td>\n",
       "      <td>1.26</td>\n",
       "      <td>3.924809</td>\n",
       "      <td>39.248094</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13609</th>\n",
       "      <td>1906</td>\n",
       "      <td>7855</td>\n",
       "      <td>924</td>\n",
       "      <td>1118848627500</td>\n",
       "      <td>46.065</td>\n",
       "      <td>2046.193052</td>\n",
       "      <td>6452583.776</td>\n",
       "      <td>1872002.169</td>\n",
       "      <td>12.5</td>\n",
       "      <td>5.0</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>1891</td>\n",
       "      <td>1907</td>\n",
       "      <td>117.97</td>\n",
       "      <td>2.98</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0.00</td>\n",
       "      <td>3.927859</td>\n",
       "      <td>39.278592</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13610</th>\n",
       "      <td>1906</td>\n",
       "      <td>7856</td>\n",
       "      <td>924</td>\n",
       "      <td>1118848627600</td>\n",
       "      <td>46.163</td>\n",
       "      <td>2050.120197</td>\n",
       "      <td>6452586.772</td>\n",
       "      <td>1871999.600</td>\n",
       "      <td>12.5</td>\n",
       "      <td>5.0</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>1907</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.098</td>\n",
       "      <td>0.98</td>\n",
       "      <td>3.927146</td>\n",
       "      <td>39.271455</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>4200 rows × 23 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       Vehicle_ID  Frame_ID  Total_Frames    Global_Time  Local_X  \\\n",
       "41             11       831           654  1118847925100   31.073   \n",
       "42             11       832           654  1118847925200   31.096   \n",
       "43             11       833           654  1118847925300   31.120   \n",
       "44             11       834           654  1118847925400   31.132   \n",
       "45             11       835           654  1118847925500   31.122   \n",
       "...           ...       ...           ...            ...      ...   \n",
       "13606        1906      7852           924  1118848627200   45.670   \n",
       "13607        1906      7853           924  1118848627300   45.939   \n",
       "13608        1906      7854           924  1118848627400   46.065   \n",
       "13609        1906      7855           924  1118848627500   46.065   \n",
       "13610        1906      7856           924  1118848627600   46.163   \n",
       "\n",
       "           Local_Y     Global_X     Global_Y  v_Length  v_Width  ...  Lane_ID  \\\n",
       "41     1826.355878  6452425.171  1872157.346      17.0      6.4  ...        3   \n",
       "42     1831.427895  6452428.947  1872154.069      17.0      6.4  ...        3   \n",
       "43     1836.510543  6452432.723  1872150.792      17.0      6.4  ...        3   \n",
       "44     1841.603540  6452436.499  1872147.514      17.0      6.4  ...        3   \n",
       "45     1846.706961  6452440.275  1872144.237      17.0      6.4  ...        3   \n",
       "...            ...          ...          ...       ...      ...  ...      ...   \n",
       "13606  2034.419128  6452574.737  1872010.049      12.5      5.0  ...        4   \n",
       "13607  2038.340383  6452577.678  1872007.304      12.5      5.0  ...        4   \n",
       "13608  2042.265192  6452580.673  1872004.699      12.5      5.0  ...        4   \n",
       "13609  2046.193052  6452583.776  1872002.169      12.5      5.0  ...        4   \n",
       "13610  2050.120197  6452586.772  1871999.600      12.5      5.0  ...        4   \n",
       "\n",
       "       Preceeding  Following  Space_Hdwy  Time_Hdwy      x   x_a         y  \\\n",
       "41              7         15       68.67       1.37  0.024  0.24  5.061758   \n",
       "42              7         15       69.19       1.37  0.023  0.23  5.072018   \n",
       "43              7         15       69.70       1.38  0.024  0.24  5.082648   \n",
       "44              7         15       70.25       1.39  0.012  0.12  5.092997   \n",
       "45              7         15       70.91       1.41 -0.010 -0.10  5.103421   \n",
       "...           ...        ...         ...        ...    ...   ...       ...   \n",
       "13606        1891       1907      117.96       2.94  0.456  4.56  3.916751   \n",
       "13607        1891       1907      117.95       2.95  0.269  2.69  3.921255   \n",
       "13608        1891       1907      117.95       2.96  0.126  1.26  3.924809   \n",
       "13609        1891       1907      117.97       2.98  0.000  0.00  3.927859   \n",
       "13610           0       1907        0.00       0.00  0.098  0.98  3.927146   \n",
       "\n",
       "             y_v  label  \n",
       "41     50.617583      2  \n",
       "42     50.720176      2  \n",
       "43     50.826477      2  \n",
       "44     50.929970      2  \n",
       "45     51.034206      2  \n",
       "...          ...    ...  \n",
       "13606  39.167513      2  \n",
       "13607  39.212552      2  \n",
       "13608  39.248094      2  \n",
       "13609  39.278592      2  \n",
       "13610  39.271455      2  \n",
       "\n",
       "[4200 rows x 23 columns]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#根据索引分别截取右转左转的车辆数据帧，前40帧，并添加标签\n",
    "TR40=f2.loc[TR_row]\n",
    "TR40['label']=2\n",
    "TL40=f2.loc[TL_row]\n",
    "TL40['label']=1\n",
    "TR40"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "9317c5a1-55b1-4be3-86cb-230067961b87",
   "metadata": {},
   "outputs": [],
   "source": [
    "df_combine = pd.concat([TR40, TL40], ignore_index=True)       #将左右转的数据合并起来，并重置索引\n",
    "df_combine.to_csv(\"./data/RL_label.csv\",index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "9ba2535e-98c0-4a8c-a7fa-35e87819250b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Vehicle_ID</th>\n",
       "      <th>Frame_ID</th>\n",
       "      <th>Total_Frames</th>\n",
       "      <th>Global_Time</th>\n",
       "      <th>Local_X</th>\n",
       "      <th>Local_Y</th>\n",
       "      <th>Global_X</th>\n",
       "      <th>Global_Y</th>\n",
       "      <th>v_Length</th>\n",
       "      <th>v_Width</th>\n",
       "      <th>...</th>\n",
       "      <th>Lane_ID</th>\n",
       "      <th>Preceeding</th>\n",
       "      <th>Following</th>\n",
       "      <th>Space_Hdwy</th>\n",
       "      <th>Time_Hdwy</th>\n",
       "      <th>x</th>\n",
       "      <th>x_a</th>\n",
       "      <th>y</th>\n",
       "      <th>y_v</th>\n",
       "      <th>label</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>11</td>\n",
       "      <td>831</td>\n",
       "      <td>654</td>\n",
       "      <td>1118847925100</td>\n",
       "      <td>31.073</td>\n",
       "      <td>1826.355878</td>\n",
       "      <td>6452425.171</td>\n",
       "      <td>1872157.346</td>\n",
       "      <td>17.0</td>\n",
       "      <td>6.4</td>\n",
       "      <td>...</td>\n",
       "      <td>3</td>\n",
       "      <td>7</td>\n",
       "      <td>15</td>\n",
       "      <td>68.67</td>\n",
       "      <td>1.37</td>\n",
       "      <td>0.024</td>\n",
       "      <td>0.24</td>\n",
       "      <td>5.061758</td>\n",
       "      <td>50.617583</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>11</td>\n",
       "      <td>832</td>\n",
       "      <td>654</td>\n",
       "      <td>1118847925200</td>\n",
       "      <td>31.096</td>\n",
       "      <td>1831.427895</td>\n",
       "      <td>6452428.947</td>\n",
       "      <td>1872154.069</td>\n",
       "      <td>17.0</td>\n",
       "      <td>6.4</td>\n",
       "      <td>...</td>\n",
       "      <td>3</td>\n",
       "      <td>7</td>\n",
       "      <td>15</td>\n",
       "      <td>69.19</td>\n",
       "      <td>1.37</td>\n",
       "      <td>0.023</td>\n",
       "      <td>0.23</td>\n",
       "      <td>5.072018</td>\n",
       "      <td>50.720176</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>11</td>\n",
       "      <td>833</td>\n",
       "      <td>654</td>\n",
       "      <td>1118847925300</td>\n",
       "      <td>31.120</td>\n",
       "      <td>1836.510543</td>\n",
       "      <td>6452432.723</td>\n",
       "      <td>1872150.792</td>\n",
       "      <td>17.0</td>\n",
       "      <td>6.4</td>\n",
       "      <td>...</td>\n",
       "      <td>3</td>\n",
       "      <td>7</td>\n",
       "      <td>15</td>\n",
       "      <td>69.70</td>\n",
       "      <td>1.38</td>\n",
       "      <td>0.024</td>\n",
       "      <td>0.24</td>\n",
       "      <td>5.082648</td>\n",
       "      <td>50.826477</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>11</td>\n",
       "      <td>834</td>\n",
       "      <td>654</td>\n",
       "      <td>1118847925400</td>\n",
       "      <td>31.132</td>\n",
       "      <td>1841.603540</td>\n",
       "      <td>6452436.499</td>\n",
       "      <td>1872147.514</td>\n",
       "      <td>17.0</td>\n",
       "      <td>6.4</td>\n",
       "      <td>...</td>\n",
       "      <td>3</td>\n",
       "      <td>7</td>\n",
       "      <td>15</td>\n",
       "      <td>70.25</td>\n",
       "      <td>1.39</td>\n",
       "      <td>0.012</td>\n",
       "      <td>0.12</td>\n",
       "      <td>5.092997</td>\n",
       "      <td>50.929970</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>11</td>\n",
       "      <td>835</td>\n",
       "      <td>654</td>\n",
       "      <td>1118847925500</td>\n",
       "      <td>31.122</td>\n",
       "      <td>1846.706961</td>\n",
       "      <td>6452440.275</td>\n",
       "      <td>1872144.237</td>\n",
       "      <td>17.0</td>\n",
       "      <td>6.4</td>\n",
       "      <td>...</td>\n",
       "      <td>3</td>\n",
       "      <td>7</td>\n",
       "      <td>15</td>\n",
       "      <td>70.91</td>\n",
       "      <td>1.41</td>\n",
       "      <td>-0.010</td>\n",
       "      <td>-0.10</td>\n",
       "      <td>5.103421</td>\n",
       "      <td>51.034206</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13115</th>\n",
       "      <td>1914</td>\n",
       "      <td>7000</td>\n",
       "      <td>923</td>\n",
       "      <td>1118848542000</td>\n",
       "      <td>13.153</td>\n",
       "      <td>366.480825</td>\n",
       "      <td>6451343.568</td>\n",
       "      <td>1873135.764</td>\n",
       "      <td>16.5</td>\n",
       "      <td>6.4</td>\n",
       "      <td>...</td>\n",
       "      <td>2</td>\n",
       "      <td>1928</td>\n",
       "      <td>1939</td>\n",
       "      <td>41.36</td>\n",
       "      <td>1.25</td>\n",
       "      <td>-0.154</td>\n",
       "      <td>-1.54</td>\n",
       "      <td>3.435227</td>\n",
       "      <td>34.352273</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13116</th>\n",
       "      <td>1914</td>\n",
       "      <td>7001</td>\n",
       "      <td>923</td>\n",
       "      <td>1118848542100</td>\n",
       "      <td>12.851</td>\n",
       "      <td>369.891951</td>\n",
       "      <td>6451346.112</td>\n",
       "      <td>1873133.726</td>\n",
       "      <td>16.5</td>\n",
       "      <td>6.4</td>\n",
       "      <td>...</td>\n",
       "      <td>2</td>\n",
       "      <td>1928</td>\n",
       "      <td>1939</td>\n",
       "      <td>41.10</td>\n",
       "      <td>1.26</td>\n",
       "      <td>-0.302</td>\n",
       "      <td>-3.02</td>\n",
       "      <td>3.411126</td>\n",
       "      <td>34.111262</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13117</th>\n",
       "      <td>1914</td>\n",
       "      <td>7002</td>\n",
       "      <td>923</td>\n",
       "      <td>1118848542200</td>\n",
       "      <td>12.519</td>\n",
       "      <td>373.280969</td>\n",
       "      <td>6451348.671</td>\n",
       "      <td>1873131.714</td>\n",
       "      <td>16.5</td>\n",
       "      <td>6.4</td>\n",
       "      <td>...</td>\n",
       "      <td>2</td>\n",
       "      <td>1928</td>\n",
       "      <td>1939</td>\n",
       "      <td>40.86</td>\n",
       "      <td>1.26</td>\n",
       "      <td>-0.332</td>\n",
       "      <td>-3.32</td>\n",
       "      <td>3.389018</td>\n",
       "      <td>33.890178</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13118</th>\n",
       "      <td>1914</td>\n",
       "      <td>7003</td>\n",
       "      <td>923</td>\n",
       "      <td>1118848542300</td>\n",
       "      <td>12.212</td>\n",
       "      <td>376.649614</td>\n",
       "      <td>6451351.221</td>\n",
       "      <td>1873129.677</td>\n",
       "      <td>16.5</td>\n",
       "      <td>6.4</td>\n",
       "      <td>...</td>\n",
       "      <td>2</td>\n",
       "      <td>1928</td>\n",
       "      <td>1939</td>\n",
       "      <td>40.62</td>\n",
       "      <td>1.25</td>\n",
       "      <td>-0.307</td>\n",
       "      <td>-3.07</td>\n",
       "      <td>3.368645</td>\n",
       "      <td>33.686446</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13119</th>\n",
       "      <td>1914</td>\n",
       "      <td>7004</td>\n",
       "      <td>923</td>\n",
       "      <td>1118848542400</td>\n",
       "      <td>11.904</td>\n",
       "      <td>379.999326</td>\n",
       "      <td>6451353.771</td>\n",
       "      <td>1873127.640</td>\n",
       "      <td>16.5</td>\n",
       "      <td>6.4</td>\n",
       "      <td>...</td>\n",
       "      <td>2</td>\n",
       "      <td>1928</td>\n",
       "      <td>1939</td>\n",
       "      <td>40.37</td>\n",
       "      <td>1.24</td>\n",
       "      <td>-0.308</td>\n",
       "      <td>-3.08</td>\n",
       "      <td>3.349713</td>\n",
       "      <td>33.497126</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>13120 rows × 23 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       Vehicle_ID  Frame_ID  Total_Frames    Global_Time  Local_X  \\\n",
       "0              11       831           654  1118847925100   31.073   \n",
       "1              11       832           654  1118847925200   31.096   \n",
       "2              11       833           654  1118847925300   31.120   \n",
       "3              11       834           654  1118847925400   31.132   \n",
       "4              11       835           654  1118847925500   31.122   \n",
       "...           ...       ...           ...            ...      ...   \n",
       "13115        1914      7000           923  1118848542000   13.153   \n",
       "13116        1914      7001           923  1118848542100   12.851   \n",
       "13117        1914      7002           923  1118848542200   12.519   \n",
       "13118        1914      7003           923  1118848542300   12.212   \n",
       "13119        1914      7004           923  1118848542400   11.904   \n",
       "\n",
       "           Local_Y     Global_X     Global_Y  v_Length  v_Width  ...  Lane_ID  \\\n",
       "0      1826.355878  6452425.171  1872157.346      17.0      6.4  ...        3   \n",
       "1      1831.427895  6452428.947  1872154.069      17.0      6.4  ...        3   \n",
       "2      1836.510543  6452432.723  1872150.792      17.0      6.4  ...        3   \n",
       "3      1841.603540  6452436.499  1872147.514      17.0      6.4  ...        3   \n",
       "4      1846.706961  6452440.275  1872144.237      17.0      6.4  ...        3   \n",
       "...            ...          ...          ...       ...      ...  ...      ...   \n",
       "13115   366.480825  6451343.568  1873135.764      16.5      6.4  ...        2   \n",
       "13116   369.891951  6451346.112  1873133.726      16.5      6.4  ...        2   \n",
       "13117   373.280969  6451348.671  1873131.714      16.5      6.4  ...        2   \n",
       "13118   376.649614  6451351.221  1873129.677      16.5      6.4  ...        2   \n",
       "13119   379.999326  6451353.771  1873127.640      16.5      6.4  ...        2   \n",
       "\n",
       "       Preceeding  Following  Space_Hdwy  Time_Hdwy      x   x_a         y  \\\n",
       "0               7         15       68.67       1.37  0.024  0.24  5.061758   \n",
       "1               7         15       69.19       1.37  0.023  0.23  5.072018   \n",
       "2               7         15       69.70       1.38  0.024  0.24  5.082648   \n",
       "3               7         15       70.25       1.39  0.012  0.12  5.092997   \n",
       "4               7         15       70.91       1.41 -0.010 -0.10  5.103421   \n",
       "...           ...        ...         ...        ...    ...   ...       ...   \n",
       "13115        1928       1939       41.36       1.25 -0.154 -1.54  3.435227   \n",
       "13116        1928       1939       41.10       1.26 -0.302 -3.02  3.411126   \n",
       "13117        1928       1939       40.86       1.26 -0.332 -3.32  3.389018   \n",
       "13118        1928       1939       40.62       1.25 -0.307 -3.07  3.368645   \n",
       "13119        1928       1939       40.37       1.24 -0.308 -3.08  3.349713   \n",
       "\n",
       "             y_v  label  \n",
       "0      50.617583      2  \n",
       "1      50.720176      2  \n",
       "2      50.826477      2  \n",
       "3      50.929970      2  \n",
       "4      51.034206      2  \n",
       "...          ...    ...  \n",
       "13115  34.352273      1  \n",
       "13116  34.111262      1  \n",
       "13117  33.890178      1  \n",
       "13118  33.686446      1  \n",
       "13119  33.497126      1  \n",
       "\n",
       "[13120 rows x 23 columns]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_combine"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
